home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Updaters / WhiteCap 3.0.4 / WhiteCap Source.sit / WhiteCap Source / Headers / WhiteCapWorld.h < prev    next >
C/C++ Source or Header  |  1999-08-21  |  2KB  |  90 lines

  1. #pragma once
  2.  
  3.  
  4. class Sample;
  5. class ArgList;
  6. class CEgFileSpec;
  7. class PixPort;
  8.  
  9. #if EG_MAC
  10. #include <Quickdraw.h>
  11. #endif
  12.  
  13. #include "XPtrList.h"
  14. #include "WC_WaveShape.h"
  15. #include "Camera.h"
  16. #include "ExpressionDict.h"
  17.  
  18. struct ScrnPt {
  19.     long x, y;
  20.     RGBColor color;
  21. };
  22.  
  23.  
  24.  
  25. class WhiteCapWorld {
  26.  
  27.     public:
  28.                         WhiteCapWorld();
  29.                         ~WhiteCapWorld();
  30.         
  31.         void             Init( const CEgFileSpec* inConfig, long inTransitionTime );
  32.                 
  33.         void            RecordSample( long inCurTime, const float inSpectrum[] );
  34.  
  35.         void            Render( long inCurTime, PixPort& inDest, Rect& outDirtyRect );
  36.         
  37.         void            SetPaneRect( const Rect& inRect );
  38.         
  39.         void            RefreshRect( const Rect& inRect );
  40.  
  41.         const Rect*        PaneRect() const            { return &mPaneRect;    }
  42.     
  43.         void            ExpireSamples();
  44.         
  45.         // Draws the config title string to inPort and updates mTitleRect
  46.         void            DrawConfigName( void* inPort );    
  47.         
  48.         Rect            mTitleRect;            // Where the title currently resides
  49.  
  50.     protected:
  51.         WC_WaveShape    mWave1, mWave2;
  52.         WC_WaveShape*    mNextWave, *mWave;
  53.         
  54.         float            mNextShapeChange;
  55.         long            mTransitionEnd;
  56.         long            mTransitionTime;
  57.         #define            TRANSITION_ALPHA    1.7
  58.         
  59.         
  60.         Camera            mCamera;
  61.         
  62.         // The current background color
  63.         long            mCurBackClr;
  64.         RGBColor        mCurBackClrRGB;
  65.         RGBColor        mTextColor;
  66.  
  67.  
  68.         Rect            mRenderedRect;        // The part in pane that's not background
  69.     
  70.         Rect            mPaneRect;
  71.  
  72.  
  73.         float*            mMagPtr;
  74.         float            mT, mDT, mST, mS, mBass1, mBass2, mBass3, mTransitionT, mPi, mNumSampleBins;
  75.         ExpressionDict    mDict;
  76.                 
  77.             
  78.         
  79.         // Stuff dealing with keeping track of the sample data
  80.         long                    mLastSampleTime;
  81.         Sample*                    mSamples;
  82.         Sample*                    mRecentSample;
  83.         XPtrList                mFreeList;
  84.         void                    discardExpiredRows( long inCurTime );
  85.  
  86.  
  87.  
  88. };
  89.  
  90.